package br.uefs.cedoc.controle.teste;

import br.uefs.cedoc.controle.*;
import br.uefs.cedoc.db.exception.DBConnectionException;
import javax.servlet.*;
import javax.servlet.http.*;
import br.uefs.cedoc.db.*;
import br.uefs.cedoc.db.serie.DBSerie;
import br.uefs.cedoc.entidades.*;
import java.sql.SQLException;
  
public class GetCommand implements Command {
  private String next;

  public GetCommand(String next) {
    this.next = next;
  }

    public String execute(HttpServletRequest req)
    throws CommandException {
        try {
            
            DBSerie dbserie = new DBSerie();
            SerieBean serie = new SerieBean();            
            //serie.setIdserie();
            int id = Integer.parseInt(req.getParameter("id"));
            serie = dbserie.listaSerie(id);
            req.setAttribute("serie",serie);

            } catch (SQLException ex) {
                ex.printStackTrace();
            } catch (DBConnectionException ex) {
                ex.printStackTrace();
            }

            req.setAttribute("status.msg", "Serie");
            
            return next;

    }
}

